import request from '@/utils/request'

//待分配的工单任务 - 驻点经理
export function assignedList(params) {
  return request({
    url: '/inspection/task/assignedList',
    method: 'get',
    params
  })
}

//待处理的工单任务 - 驻点经理
export function todoList(params) {
  return request({
    url: '/inspection/task/todoList',
    method: 'get',
    params
  })
}

//分配给我的待处理的工单任务
export function myTodoList(params) {
  return request({
    url: '/inspection/task/myTodoList',
    method: 'get',
    params
  })
}

//已完成的工单任务 - 驻点经理
export function finishList(params) {
  return request({
    url: '/inspection/task/finishList',
    method: 'get',
    params,
    isCancel: true,
  })
}

//已完成的工单任务 - 工程师
export function myFinishList(params) {
  return request({
    url: '/inspection/task/myFinishList',
    method: 'get',
    params,
    isCancel: true
  })
}

// 获取巡检工单列表
export function workOrderInfo(params) {
  return request({
    url: '/inspection/task/' + params,
    method: 'get',
  })
}
// 分配工程师
export function assignEngineer(data) {
  return request({
    url: '/inspection/task/assignEngineer',
    method: 'post',
    data
  })
}

// 批量分配工程师
export function assignEngineerBatch(data) {
  return request({
    url: '/inspection/task/assignEngineerBatch',
    method: 'post',
    data
  })
}

//巡检开始
export function workOrderStart(data) {
  return request({
    url: '/inspection/task/start',
    method: 'put',
    data
  })
}
//巡检完成
export function workOrderFinish(data) {
  return request({
    url: '/inspection/task/finish',
    method: 'put',
    data
  })
}

//巡检提交
export function submit(data) {
  return request({
    url: '/inspection/task/submit',
    method: 'post',
    data,
    preventResponseInterceptor: true
  })
}

//巡检签名
export function querySign(workOrderId) {
  return request({
    url: '/inspection/task/querySignList/' + workOrderId,
    method: 'get',
  })
}

//延长截止时间
export function delayEndDate(data) {
  return request({
    url: '/inspection/task/delayEndDate',
    method: 'post',
    data
  })
}

//批量延长截止时间
export function delayEndDateBatch(data) {
  return request({
    url: '/inspection/task/delayEndDateBatch',
    method: 'post',
    data
  })
}
//获取巡检工单列表
export function allStatusList(params) {
  return request({
    url: '/inspection/task/list',
    method: 'get',
    params
  })
}